<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>XenC: PPL Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">XenC
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">Open-source tool for data selection in NLP</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="class_p_p_l-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">PPL Class Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Perplexity/Cross-entropy computations.  
 <a href="class_p_p_l.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="ppl_8h_source.html">ppl.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a26f147c5abe353cef005fe0360571088"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a26f147c5abe353cef005fe0360571088">PPL</a> ()</td></tr>
<tr class="memdesc:a26f147c5abe353cef005fe0360571088"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <a href="#a26f147c5abe353cef005fe0360571088">More...</a><br /></td></tr>
<tr class="separator:a26f147c5abe353cef005fe0360571088"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6d5f0795cba727814724961addc7684b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a6d5f0795cba727814724961addc7684b">initialize</a> (boost::shared_ptr&lt; <a class="el" href="class_corpus.html">Corpus</a> &gt; ptrCorp, boost::shared_ptr&lt; <a class="el" href="class_xen_l_mken.html">XenLMken</a> &gt; ptrLM)</td></tr>
<tr class="separator:a6d5f0795cba727814724961addc7684b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a15f668096ea5c3ec9e133daeb9c36c4c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a15f668096ea5c3ec9e133daeb9c36c4c">initialize</a> (boost::shared_ptr&lt; <a class="el" href="class_phrase_table.html">PhraseTable</a> &gt; ptrPT, boost::shared_ptr&lt; <a class="el" href="class_xen_l_mken.html">XenLMken</a> &gt; ptrLM, bool source)</td></tr>
<tr class="separator:a15f668096ea5c3ec9e133daeb9c36c4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ffcdd55a46d1d1ec35935d41aa769bb"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a2ffcdd55a46d1d1ec35935d41aa769bb">~PPL</a> ()</td></tr>
<tr class="memdesc:a2ffcdd55a46d1d1ec35935d41aa769bb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default destructor.  <a href="#a2ffcdd55a46d1d1ec35935d41aa769bb">More...</a><br /></td></tr>
<tr class="separator:a2ffcdd55a46d1d1ec35935d41aa769bb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab5afb2846e074d442173517846e0a479"><td class="memItemLeft" align="right" valign="top">unsigned int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#ab5afb2846e074d442173517846e0a479">getSize</a> () const </td></tr>
<tr class="memdesc:ab5afb2846e074d442173517846e0a479"><td class="mdescLeft">&#160;</td><td class="mdescRight">Accessor to the size of the perplexity/cross-entropy vector.  <a href="#ab5afb2846e074d442173517846e0a479">More...</a><br /></td></tr>
<tr class="separator:ab5afb2846e074d442173517846e0a479"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a81f97efa4fe83f7d61d293cdbc28c3b3"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a81f97efa4fe83f7d61d293cdbc28c3b3">getPPL</a> (int n)</td></tr>
<tr class="memdesc:a81f97efa4fe83f7d61d293cdbc28c3b3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Accessor to the nth perplexity score.  <a href="#a81f97efa4fe83f7d61d293cdbc28c3b3">More...</a><br /></td></tr>
<tr class="separator:a81f97efa4fe83f7d61d293cdbc28c3b3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3032dfe8c3103e44a6aba322a537c925"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a3032dfe8c3103e44a6aba322a537c925">getXE</a> (int n)</td></tr>
<tr class="memdesc:a3032dfe8c3103e44a6aba322a537c925"><td class="mdescLeft">&#160;</td><td class="mdescRight">Accessor to the nth cross-entropy score.  <a href="#a3032dfe8c3103e44a6aba322a537c925">More...</a><br /></td></tr>
<tr class="separator:a3032dfe8c3103e44a6aba322a537c925"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a664161b9bda71de84617947fae966d3b"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a664161b9bda71de84617947fae966d3b">getCorpPPL</a> ()</td></tr>
<tr class="memdesc:a664161b9bda71de84617947fae966d3b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Accessor to the document-level perplexity score.  <a href="#a664161b9bda71de84617947fae966d3b">More...</a><br /></td></tr>
<tr class="separator:a664161b9bda71de84617947fae966d3b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b4657c023618ae0beb8101b82cf3005"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a7b4657c023618ae0beb8101b82cf3005">calcPPLCorpus</a> ()</td></tr>
<tr class="memdesc:a7b4657c023618ae0beb8101b82cf3005"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the perplexity of a <a class="el" href="class_corpus.html" title="Corpus-related functionalities. ">Corpus</a> sentence by sentence.  <a href="#a7b4657c023618ae0beb8101b82cf3005">More...</a><br /></td></tr>
<tr class="separator:a7b4657c023618ae0beb8101b82cf3005"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a49004246863fdf55c41be3b575f0a443"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_p_l.html#a49004246863fdf55c41be3b575f0a443">calcPPLPhraseTable</a> ()</td></tr>
<tr class="memdesc:a49004246863fdf55c41be3b575f0a443"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the perplexity of a <a class="el" href="class_phrase_table.html" title="Class handling phrase-table related functionalities. ">PhraseTable</a> phrase by phrase.  <a href="#a49004246863fdf55c41be3b575f0a443">More...</a><br /></td></tr>
<tr class="separator:a49004246863fdf55c41be3b575f0a443"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Perplexity/Cross-entropy computations. </p>
<p>This class handles the perplexity/cross-entropy computations in XenC. It uses threads extensively to compute scores simultaneously. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a26f147c5abe353cef005fe0360571088"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PPL::PPL </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Default constructor. </p>

</div>
</div>
<a class="anchor" id="a2ffcdd55a46d1d1ec35935d41aa769bb"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">PPL::~PPL </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Default destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a7b4657c023618ae0beb8101b82cf3005"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PPL::calcPPLCorpus </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes the perplexity of a <a class="el" href="class_corpus.html" title="Corpus-related functionalities. ">Corpus</a> sentence by sentence. </p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="class_p_p_l_a7b4657c023618ae0beb8101b82cf3005_cgraph.png" border="0" usemap="#class_p_p_l_a7b4657c023618ae0beb8101b82cf3005_cgraph" alt=""/></div>
<map name="class_p_p_l_a7b4657c023618ae0beb8101b82cf3005_cgraph" id="class_p_p_l_a7b4657c023618ae0beb8101b82cf3005_cgraph">
<area shape="rect" id="node2" href="class_xen_option.html#a97ad096aee729b4d8ae993b1381d4eec" title="Accessor to the instance of the singleton XenOption object. " alt="" coords="412,5,573,31"/>
<area shape="rect" id="node3" href="class_xen_option.html#a1e63941bf583b329394def43e580bbd6" title="Accessor to the requested number of threads. " alt="" coords="199,31,358,56"/>
<area shape="rect" id="node4" href="ppl_8cpp.html#a0c876aa154ae0422fad090aad9f79b7f" title="Thread&#45;safe perplexity computation function. " alt="" coords="230,80,328,105"/>
<area shape="rect" id="node5" href="class_xen_option.html#a188caff8f2bc09b17895e59afdc4e3b5" title="Accessor to the OOVs exclusion state. " alt="" coords="406,80,578,105"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a49004246863fdf55c41be3b575f0a443"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PPL::calcPPLPhraseTable </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Computes the perplexity of a <a class="el" href="class_phrase_table.html" title="Class handling phrase-table related functionalities. ">PhraseTable</a> phrase by phrase. </p>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="class_p_p_l_a49004246863fdf55c41be3b575f0a443_cgraph.png" border="0" usemap="#class_p_p_l_a49004246863fdf55c41be3b575f0a443_cgraph" alt=""/></div>
<map name="class_p_p_l_a49004246863fdf55c41be3b575f0a443_cgraph" id="class_p_p_l_a49004246863fdf55c41be3b575f0a443_cgraph">
<area shape="rect" id="node2" href="class_xen_option.html#a97ad096aee729b4d8ae993b1381d4eec" title="Accessor to the instance of the singleton XenOption object. " alt="" coords="443,5,604,31"/>
<area shape="rect" id="node3" href="class_xen_option.html#a1e63941bf583b329394def43e580bbd6" title="Accessor to the requested number of threads. " alt="" coords="230,31,390,56"/>
<area shape="rect" id="node4" href="ppl_8cpp.html#a0c876aa154ae0422fad090aad9f79b7f" title="Thread&#45;safe perplexity computation function. " alt="" coords="261,80,359,105"/>
<area shape="rect" id="node5" href="class_xen_option.html#a188caff8f2bc09b17895e59afdc4e3b5" title="Accessor to the OOVs exclusion state. " alt="" coords="438,80,609,105"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a664161b9bda71de84617947fae966d3b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double PPL::getCorpPPL </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Accessor to the document-level perplexity score. </p>
<dl class="section return"><dt>Returns</dt><dd>double representing the document perplexity score </dd></dl>

<p><div class="dynheader">
Here is the call graph for this function:</div>
<div class="dyncontent">
<div class="center"><img src="class_p_p_l_a664161b9bda71de84617947fae966d3b_cgraph.png" border="0" usemap="#class_p_p_l_a664161b9bda71de84617947fae966d3b_cgraph" alt=""/></div>
<map name="class_p_p_l_a664161b9bda71de84617947fae966d3b_cgraph" id="class_p_p_l_a664161b9bda71de84617947fae966d3b_cgraph">
<area shape="rect" id="node2" href="class_xen_option.html#a97ad096aee729b4d8ae993b1381d4eec" title="Accessor to the instance of the singleton XenOption object. " alt="" coords="185,5,346,31"/>
<area shape="rect" id="node3" href="class_xen_option.html#a188caff8f2bc09b17895e59afdc4e3b5" title="Accessor to the OOVs exclusion state. " alt="" coords="180,55,352,80"/>
</map>
</div>
</p>

</div>
</div>
<a class="anchor" id="a81f97efa4fe83f7d61d293cdbc28c3b3"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double PPL::getPPL </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Accessor to the nth perplexity score. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>: integer indicating the position of the score to return </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>double representing the nth perplexity score </dd></dl>

</div>
</div>
<a class="anchor" id="ab5afb2846e074d442173517846e0a479"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">unsigned int PPL::getSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Accessor to the size of the perplexity/cross-entropy vector. </p>
<dl class="section return"><dt>Returns</dt><dd>unsigned int representing the size </dd></dl>

</div>
</div>
<a class="anchor" id="a3032dfe8c3103e44a6aba322a537c925"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">double PPL::getXE </td>
          <td>(</td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>n</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Accessor to the nth cross-entropy score. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">n</td><td>: integer indicating the position of the score to return </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>double representing the nth cross-entropy score </dd></dl>

</div>
</div>
<a class="anchor" id="a6d5f0795cba727814724961addc7684b"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PPL::initialize </td>
          <td>(</td>
          <td class="paramtype">boost::shared_ptr&lt; <a class="el" href="class_corpus.html">Corpus</a> &gt;&#160;</td>
          <td class="paramname"><em>ptrCorp</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">boost::shared_ptr&lt; <a class="el" href="class_xen_l_mken.html">XenLMken</a> &gt;&#160;</td>
          <td class="paramname"><em>ptrLM</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<a class="anchor" id="a15f668096ea5c3ec9e133daeb9c36c4c"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void PPL::initialize </td>
          <td>(</td>
          <td class="paramtype">boost::shared_ptr&lt; <a class="el" href="class_phrase_table.html">PhraseTable</a> &gt;&#160;</td>
          <td class="paramname"><em>ptrPT</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">boost::shared_ptr&lt; <a class="el" href="class_xen_l_mken.html">XenLMken</a> &gt;&#160;</td>
          <td class="paramname"><em>ptrLM</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>source</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>include/<a class="el" href="ppl_8h_source.html">ppl.h</a></li>
<li>src/<a class="el" href="ppl_8cpp.html">ppl.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Mar 18 2016 17:22:37 for XenC by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>
